#include <bits/stdc++.h>
#define lb(x) (x&-x)
#define rep(i,x,y) for(ll i=(x);i<=(y);i++)
#define per(i,x,y) for(ll i=(x);i>=(y);i--)
using namespace std;
using ll=long long;
const ll N=300005;
ll n,k,q,a[N],x[N],y[N];
struct Bit{
	ll c[N];
	void update(ll x,ll val){
		for(;x<=n;x+=lb(x)){
			c[x]+=val;
		}
	}
	ll query(ll x){
		ll sum=0;
		for(;x;x-=lb(x)){
			sum+=c[x];
		}
		return sum;
	}
}bt;
int main(){
	ios::sync_with_stdio(0),cin.tie(0);
	freopen("random.in","r",stdin);
	freopen("random.out","w",stdout);
	cin>>n>>k>>q;
	rep(i,1,n){
		cin>>a[i];
	}
	rep(i,1,q){
		cin>>x[i]>>y[i];
	}
	ll ans=0;
	per(i,n,1){
		ans+=bt.query(a[i]);
		bt.update(a[i],1);
	}
	cout<<ans<<'\n';
	return 0;
}
